STEP 8: Let's use the user input to decide what our program does next! We'll use a new section of the toolkit here!

  • In LOGIC, click on . Drag out if. The line that you drag out is the test statement.
  • Change the variable to the left of the == to soccer_ans. This is the test variable.
  • In GRAPHICS, click on . Drag out Soccer Field. Drop it INSIDE your if block.
  • The variable soccer_ans holds the user's answer. The == checks to see if that response is the string "yes".

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)